<?php

namespace App\Admin\Requests;

class AdminUserLoginRequest extends Request
{
    public function rules()
    {
        $rules = [
            'staff_id' => 'bail|required',
            'password' => 'bail|required',
            'captcha'  => ['bail', 'required'],
        ];
        if (config("app.env") == 'online') {
            $rules['captcha'][] = 'captcha';
        }
        return $rules;
    }

    public function messages()
    {
        return [
            'captcha.required' => '驗證碼不能為空',
            'captcha.captcha'  => '驗證碼錯誤',
        ];
    }
}
